#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

int removeElement(int* nums, int numsSize, int val) {
    int beg = 0;
    int end = numsSize;
    while (beg < end)
    {
        if (nums[beg] == val)
        {
            nums[beg] = nums[end - 1];
            end--;
        }
        else
        {
            beg++;
        }
    }
    return beg;
}

int main()
{
    int arr[] = { 1,2,2,3,4,5,11,6,7,8,9,10 };
    int sz = sizeof(arr) / sizeof(arr[0]);
    int val = 0;
    scanf("%d", &val);
    int ret = removeElement(arr, sz, val);
    printf("%d\n", ret);

	return 0;
}